package com.qiang;

import java.util.*;
import java.util.stream.Collectors;

public class Demo03 {
    public static void main(String[] args) {
//        ArrayList<Integer> list = new ArrayList<>(List.of(11, 22, 33, 44, 55));
//        System.out.println(list);
//        HashMap<Integer, Integer> jj = new HashMap<>(Map.ofEntries(Map.entry(11, 22)));
//        jj.forEach((Integer k, Integer v) -> {
//            System.out.println(k + "==" + v);
//        });

        //Stream流
        ArrayList<String> list = new ArrayList<String>();
        list.add("林青霞");
        list.add("张曼玉");
        list.add("王祖贤");
        list.add("柳岩");
        list.add("张敏");
        list.add("张无忌");
//        List<String> list2 = list.stream().filter((s) -> s.startsWith("张")).filter((s) -> s.length() == 3).collect(Collectors.toList());
//        System.out.println(list2);
//        long count = list.stream().filter((s) -> s.startsWith("张")).filter((s) -> s.length() == 3).count();
//        System.out.println(count);
        Set<String> collect = list.stream().skip(2).collect(Collectors.toSet());
        System.out.println(collect);


    }
}
